package com.itheima.user.sentinel.block;

import com.alibaba.csp.sentinel.slots.block.BlockException;
import com.alibaba.fastjson.JSON;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.HashMap;
import java.util.Map;

/**
 * @Description:
 * @Version: V1.0
 */
public class DefaultBlockHandle {

    public static String block(@PathVariable("flag") int flag, BlockException ex) {

        Map map = new HashMap();
        map.put("code", 429);
        map.put("msg", "您的访问过于频繁，请稍后重试");


        return JSON.toJSONString(map);
    }

}
